{% extends "base.html" %}
{% block body %}
    {% include "nav.html" %}

    <div class="container">
        <div class="row">
            <div class="col-md-3 col-sm-3 col-xs-3"><h3>第三阶段</h3></div>
            <div class="col-md-9">
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#" aria-controls="home" role="tab" data-toggle="tab">第一季度(Q1)</a></li>
                    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">第二季度(Q2)</a></li>
                    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">第三季度(Q3)</a></li>
                    <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">第四季度(Q4)</a></li>
                  </ul>
            </div>
        </div>
        <hr>
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }}" role="alert">{{ message }}
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}

        <div class="row">
            <form action="" class="form-horizontal">
                <input type="hidden" id="id" name="id">
                <div class="form-group">
                    <label for="pay_short_interest" class="col-sm-3 control-label">21.支付短贷利息</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="pay_short_interest" name="pay_short_interest" placeholder="请填金额">
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="short_loan_repay" class="col-sm-3 control-label">22.归还短期贷款</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="short_loan_repay" name="short_loan_repay" placeholder="请填金额" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="pay_long_interest" class="col-sm-3 control-label">23.支付长贷利息</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="pay_long_interest" name="pay_long_interest" placeholder="请填金额" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="depreciation" class="col-sm-3 control-label">24.生产线折旧</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="depreciation" name="depreciation" placeholder="请填金额，但不计入现金支出" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="total_income" class="col-sm-3 control-label">25.现金收入合计</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="total_income" name="total_income" placeholder="请填金额" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="total_expense" class="col-sm-3 control-label">26.现金支出合计</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="total_expense" name="total_expense" placeholder="请填金额" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="ending_currency" class="col-sm-3 control-label">27.期末盘点</label>
                    <div class="col-sm-7">
                        <input type="text" class="form-control" id="ending_currency" name="ending_currency" placeholder="请填现金金额" disabled>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="form-group">
                    <label for="ending_currency" class="col-sm-3 control-label">28.填写财务报表，接受审计审核</label>
                    <div class="col-sm-7">
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-default form-btn hide">下一步</a>
                    </div>
                </div>
                <div class="col-sm-offset-7 col-sm-3">
                    <a href="" class="btn btn-success hide" style="float:right;margin-right:-10px;" id="form_btn_submit">进入下一阶段</a>
                </div>
            </form>
        </div>
    </div>
    <script type="application/javascript">
        $("body").on("click",".form-btn",function(){
            $(this).html("修改").removeClass("btn-default").addClass("btn-primary").addClass("form-btn-modify").removeClass("form-btn").parents(".form-group").find("input").attr("disabled",true);
            var next = $(this).parents(".form-group").next(".form-group");
            next.find("input").removeAttr("disabled");
            next.find(".form-btn").removeClass("hide");
            if(next.length==0){
                $("#form_btn_submit").removeClass("hide");
            };
        });
        $("body").on("mousedown",".form-btn-modify",function(){
            console.log(123);
        });
    </script>
{% endblock %}